II Something
by Clark Hugh Stiles
December 5, 2001 

Writing the Block -- When we write a block with this program, we don't want to nuke something by accident. So the WRITE_BLOCK call asks you to retype Control-W to write. The message length isn't checked -- it uses the "C" method of a terminating zero. As there will be more text and other data in memory page $1E, this most flexible method is preferable. The error code is in a different place than it was in the earlier MLI call code, so I'll probably rewrite that a little, placing it at the end of this, and socking it all up against $1E00. 

It might be a good idea to change that Control-W into something else, for those who are a little heavy handed on the keys. Change the CMP #$17 to CMP #$19 to make it Control-Y (Y for yes) for example. 

One last alteration -- erase the message. 

Program Listing: 
CALL -151
!
1000:LDA 24
STA 1EE3
LDA 25
STA 1EE4
LDA #$05
STA 24
LDA #$16
STA 25
JSR FC22
LDX #$00
LDA 1E00,X
BEQ 1022
JSR FDED
INX
BNE 1017
JSR FD0C
LDA C000
CMP #$17
BNE 1041 {+15}
LDA #$05
STA 24
LDA #$16
STA 25
LDX #$2D
JSR F94A
JSR BF00
NOP
NOP
NOP
BCS 1042
LDA 1EE3
STA 24
LDA 1EE4
STA 25
JSR FC22
RTS
JSR BE8B
JMP BE09

*102F:81 48 10
*1048:03 50 00 20 00 00
*1E00:C3 EF EE F4 F2 EF EC AD D9 A0 F4 EF A0 F7 F2 E9
*1E10:F4 E5 A0 F4 E8 E9 F3 A0 E9 EE E6 EF A0 F4 EF A0
*1E20:E3 F5 F2 F2 E5 EE F4 A0 E2 EC EF E3 EB 00
*1E00.1E2D
*1E00:C3 EF EE F4 F2 EF EC AD D9 A0 F4 EF A0 F7 F2 E9-Control-Y to wri
*1E10:F4 E5 A0 F4 E8 E9 F3 A0 E9 EE E6 EF A0 F4 EF A0-te this info to 
*1E20:E3 F5 F2 F2 E5 EE F4 A0 E2 EC EF E3 EB 00 -current block.
*BSAVE WRITER,A$1000,L$46
*BSAVE WRITETEXT,A$1E00,L$2E
[control-C,return] 
End of Program Listing. 

This is yet another mostly relocatable routine that provides the WRITE_BLOCK capability with a failsafe. Obviously you can't use it indiscriminately, or you could destroy your disk data. We're still not ready to put this together as one big program, because parts of it are not yet written. When used on a real Apple II equipped with a 3.5" drive of some sort, it's possible to edit Mac floppies (as long as they're HFS -- if memory serves, MFS blocks were 524 bytes long instead of 512). In Bernie mounted virtual Mac floppies and hard drives don't seem to cooperate. :') 

Don't play around until you break something. 

II Infinitum! 